#include "ECC.hpp"

void Test4()
{
    ECC ecc;
    ecc.PrintInfo();
    BigInt k = 0;
    ECC::E e;
    ECC::Point K;
    ECC::Point G;
    ecc.ECCCreateKey(k, K);
    ECC::Point C1;
    ECC::Point C2;
    BigInt r = 0;
    std::string s;
    std::cout << "输入明文: ";
    std::cin >> s;
    BigInt content = ecc.StrToBigInt(s);
    ecc.ECCEncode(content, K, r, C1, C2);
    std::cout << "密文坐标对:" << std::endl
                << "C1: " << C1 << std::endl
                << "C2: " << C2 << std::endl;
    BigInt result = ecc.ECCDecode(k, C1, C2);
    std::string c = ecc.BigIntToStr(result);
    std::cout << "解密明文: " << c << std::endl;
}
int main()
{

    // test();
    Test4();
    return 0;
}


